//RTSLinkedList 
//Extension of LinkedList<E> from SE6
//Documentation of LinkedList<E> at 
//http://java.sun.com/javase/6/docs/api/java/util/LinkedList.html
//Author: Kyle VanWie 
//Version: v1.0

import java.util.*;

public class RTSLinkedList<E> extends LinkedList<E> {

	// Default Constructor
	public RTSLinkedList() {
		super();
	}

	// Constructor that takes a collection
	// Adds the items based on the collections iterator
	public RTSLinkedList(Collection<E> objs) {
		super(objs);
	}

	// Adds item to RTSLL
	public boolean add(E Obj) {
		return super.add(Obj);
	}

	// Calls toString() of all objects in the RTSLL
	public String toString() {
		return super.toString();
	}

	public boolean rem(E Obj) {
		return super.remove(Obj);
	}

	// removes the Tileable with the desired ID
	public boolean removeID(int ID) {
		for (int i = 0; i < this.size(); i++) {
			if (((Tileable) (super.get(i))).getID() == ID) {
				super.remove(i);
				return true;
			}
		}
		return false;
	}

	// returns size of RTSLL
	public int getSize() {
		return super.size();
	}

	// returns true is empty else false
	public boolean isEmpty() {
		if (super.size() == 0)
			return true;
		else
			return false;
	}
}